package drds.binlog.data_object;


import com.google.gson.annotations.SerializedName;
import drds.binlog.common.Authors;
import drds.common.Author;
import lombok.Getter;
import lombok.Setter;

/**
 * 每个字段的数据结构
 */
@Author(name = Authors.LI_YANG)
public final class Column extends DataObject
{
    //
    @SerializedName("name")
    @Setter
    @Getter
    public volatile Object name;


    //
    /**
     * 字段下标*
     */
    @SerializedName("index")
    @Setter
    @Getter
    public int index;
    //
    @SerializedName("isNull")
    @Setter
    @Getter
    public boolean isNull;


    //
    /**
     * 字段java中类型*
     */
    @SerializedName("sqlType")
    @Setter
    @Getter
    public int sqlType;
    //
    @SerializedName("mysqlType")
    @Setter
    @Getter
    public volatile Object mysqlType;


    //
    /**
     * 是否是主键*
     */
    @SerializedName("isKey")
    @Setter
    @Getter
    public boolean isKey;
    //
    /**
     * 如果EventType=UPDATE,用于标识这个字段值是否有修改*
     */
    @SerializedName("updated")
    @Setter
    @Getter
    public boolean updated;
    //
    @SerializedName("propertyList")
    @Setter
    @Getter
    public java.util.List<KeyValuePair> propertyList = java.util.Collections.emptyList();


    //
    /**
     * 字段值,timestamp,Datetime是一个时间格式的文本 *
     */
    @SerializedName("value")
    @Setter
    @Getter
    public volatile Object value;


    //
    /**
     * 对应数据对象原始长度 *
     */
    @SerializedName("length")
    @Setter
    @Getter
    public int length;


    public Column()
    {
        name = "";
        index = 0;
        //
        sqlType = 0;
        mysqlType = "";
        //
        isKey = false;
        updated = false;
        //
        value = "";
        length = 0;

    }


}
